home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / security / crack_4.1-tar / Docs / readme.ms next >
Encoding:
Text File  |  1992-06-25  |  28.3 KB  |  835 lines

  1. .de C
  2. .ie n .B "\\$1" \\$2
  3. .el .CW "\\$1" \\$2
  4. ..
  5. .TL
  6. "Crack Version 4.1"
  7. .br
  8. A Sensible Password Checker for Unix
  9. .AU
  10. Alec D.E. Muffett
  11. .AI
  12. Unix Software Engineer
  13. Aberystwyth, Wales, UK
  14. .I "(aem@aber.ac.uk or alec_muffett@hicom.lut.ac.uk)"
  15. .AB
  16. .B Crack
  17. is a freely available program designed to find standard Unix
  18. eight-character DES encrypted passwords by standard guessing techniques
  19. outlined below.  It is written to be flexible, configurable and fast,
  20. and to be able to make use of several networked hosts via the Berkeley
  21. .C rsh
  22. program (or similar), where possible.
  23. .AE
  24. .NH 1
  25. Statement of Intent
  26. .LP
  27. This package is meant as a proving device to aid the construction of
  28. secure computer systems.  Users of Crack are advised that they may get
  29. severly hassled by authoritarian type sysadmin dudes if they run Crack
  30. without proper authorisation. 
  31. .NH 1
  32. Introduction to Version 4.0
  33. .LP
  34. Crack is now into it's fourth version, and has been reworked extensively
  35. to provide extra functionality, and the purpose of this release is to
  36. consolidate as much of this new functionality into as small a package as
  37. possible.  To this end, Crack may appear to be less configurable: it has
  38. been written on the assumption that you run a fairly modern Unix, one
  39. with BSD functionality, and then patched in order to run on other
  40. systems.
  41. .LP
  42. This, surprisingly enough, has led to neater code, and has made possible
  43. the introduction of greater flexibility which supercedes many of the
  44. options that could be configured in earlier versions of Crack.  In the
  45. same vein, some of the older options are now mandatory.  These, such as
  46. .I "feedback mode"
  47. and
  48. .C CRACK_PRINTOUT
  49. are no longer supported as options and probably never will be again.
  50. There is just a lot of wastage in not running with them, and too many
  51. dependencies in other functions to bother programming around them.
  52. .LP
  53. The user interface is basically identical to the previous versions,
  54. although some people have asked about providing X-windows GUI's to
  55. Crack, I think it would be a waste of time to do so. Crack has far
  56. less options than your ordinary version of
  57. .C /bin/ls .
  58. .NH 1
  59. Introduction to Version 4.1
  60. .LP
  61. Version 4.1 of the Crack program is an attempt to extend the features
  62. introduced in v4.0 and provide hooks for external libraries such as
  63. Michael Glad's wonderful
  64. .B UFC
  65. crypt() implementation, which (on some platforms) can outperform my
  66. fcrypt() by a factor of 3.  I have also been burdened with the task of
  67. making Crack's memory handling bombproof (hah!) in the vague hope that
  68. it will survive running out of memory on small machines.\**
  69. .FS
  70. - or even on large ones. Brian Tompsett at Hull tweaked Crack v3.3
  71. until it could run to completion after filling the swapspace on each of a
  72. network of SparcStation2's. Due to restructuring work on v4.0, I have
  73. had to write my own sorting algorithm & re-implement all of his tweaks
  74. from scratch, and can only hope that I have emulated the bombproofness
  75. of this desirable (?) functionality.
  76. .FE
  77. .LP
  78. The extensions that I mention above regard the addition of extra
  79. primitives to the dictionary processing language which permit the
  80. production of more concise dictionaries containing words, more of which
  81. are likely to be passwords.  The idea is to gain efficiency by removing
  82. some of the dross from the generated dictionaries. 
  83. .LP
  84. Crack should (generally) be more disk-space efficient now that the
  85. program can spot dictionaries which have been compressed using
  86. .I compress
  87. or
  88. .I pack
  89. and will uncompress them on the fly as necessary (using
  90. .I zcat
  91. or
  92. .I pcat 
  93. respectively).\**
  94. .FS
  95. Note to people who are short on memory or swap: do remember that to do
  96. this Crack will have to
  97. .I fork()
  98. (via
  99. .I popen() )
  100. and might not be able to create the uncompressing process.  Hence, if
  101. you intend to swaplock your machine, don't compress the dictionaries. 
  102. Switch this off by editing the
  103. .C Crack
  104. shellscript.
  105. .FE
  106. .NH 1
  107. Crack Methodology - Part 1: Internals
  108. .LP
  109. Crack takes as its input a series of password files and source
  110. dictionaries.  It merges the dictionaries, turns the password files into
  111. a sorted list, and generates lists of possible passwords from the merged
  112. dictionary or from information gleaned about users from the password
  113. file. 
  114. It does
  115. .B not
  116. attempt to remedy the problem of allowing users to have guessable
  117. passwords, and it should
  118. .B NOT
  119. be used in place of getting a really good, secure
  120. .C passwd
  121. program replacement.\**
  122. .FS
  123. See the end of ths document for more information about
  124. .I passwd
  125. replacements.
  126. .FE
  127. .LP
  128. The above paragraphs define the purpose of Crack, and embody a great
  129. deal of hard work, screams of
  130. .I Eureka! ,
  131. drunkeness, and a fair amount of swearing too.  There is a lot
  132. of thinking, philosophy, and empirical guesswork behind the way that
  133. Crack attacks password files, and although it is not perfect, I
  134. certainly hope that Crack will out-do most of it's competitors.
  135. .LP
  136. Crack works by making many individual passes over the password entries
  137. that you supply to it.  Each pass generates password guesses based upon
  138. a sequence of rules, supplied to the program by the
  139. user. The rules are specified in a simplistic language in the files
  140. .C gecos.rules
  141. and
  142. .C dicts.rules ,
  143. to be found in the
  144. .C Scripts
  145. directory.
  146. The distinction between these two files will be made clear later.
  147. .LP
  148. The rules are written as a simple string of characters, with one rule to
  149. a line.  Blank lines, and comment lines beginning with a hash character
  150. .B #
  151. are ignored.  Trailing whitespace is also ignored.  The instructions in
  152. the rule are followed from left to right, and are applied to the
  153. dictionary words one by one, as the words are loaded.  Some simple
  154. pattern matching primitives are provided for selection purposes, so that
  155. if the dictionary word does not match the pattern, it is ignored.  This
  156. saves on time and memory.  Before carrying on, I suggest that you browse
  157. through
  158. .C Scripts/dicts.rules ,
  159. take a look at the rules supplied as defaults, and try to work out what
  160. they do. 
  161. .LP
  162. The rules are stored in two different files for two different purposes.
  163. Rules in
  164. .C Scripts/gecos.rules
  165. are applied to data generated by Crack from the pw_gecos and pw_gecos
  166. entries of the user's password entry.  The data fed to the gecos rules
  167. for the user
  168. .I "aem",
  169. who is
  170. .I "Alec David Muffett, Systems"
  171. would be:
  172. .I "aem",
  173. .I "Alec",
  174. .I "David",
  175. .I "Muffett",
  176. .I "Systems",
  177. and a series of permutations of those words, either re-ordering the
  178. words and joining them together (eg:
  179. .I "AlecMuffett" ),
  180. or making up new words based on initial letters of one word taken with
  181. the rest of another (eg:
  182. .I "AMuffett" ).\**
  183. .FS
  184. - and
  185. .I ASystems
  186. and
  187. .I DSystems ,
  188. and
  189. .I MSystems ,
  190. etc... because Crack does not differentiate. Hence, care should be
  191. taken to check for redundancy when adding new rules, so as not to waste
  192. time during the gecos pass.
  193. .FE
  194. .LP
  195. The entire set of rules in gecos.rules is applied to each of these
  196. words, which creates many more permutations and combinations, all of
  197. which are tested.  Hence testing the password gecos information under
  198. Crack v4.0 and upwards takes somewhat longer than previously, but it is
  199. far more thorough. 
  200. .sp 1v
  201. .LP
  202. After a pass has been made over the data based on gecos information,
  203. Crack makes further passes over the password data using successive rules
  204. from the
  205. .C Scripts/dicts.rules
  206. by loading the whole of
  207. .C Dicts/bigdict
  208. file into memory, with the rule being applied to each word from that
  209. file.  This generates a
  210. .I "resident dictionary" ,
  211. which is sorted and uniqued so as to prevent wasting time on repetition. 
  212. After each pass is completed, the memory used by the resident dictionary
  213. is freed up, and (hopefully) re-used when the next dictionary is loaded. 
  214. .LP
  215. The
  216. .C Dicts/bigdict
  217. dictionary is created by Crack by merging, sorting, and uniq'ing the
  218. source dictionaries, which are to be found in the directory
  219. .C DictSrc
  220. and which may also be named in the Crack shellscript, via the
  221. .C $STDDICT
  222. variable. (The default value of $STDDICT is
  223. .C /usr/dict/words ).
  224. .LP
  225. The file
  226. .C DictSrc/bad_pws.dat
  227. is a dictionary which is meant to provide many of those common but
  228. non-dictionary passwords, such as
  229. .I 12345678
  230. or
  231. .I qwerty .
  232. .LP
  233. If you wish to provide a dictionary of your own, just copy it into the
  234. .C DictSrc
  235. directory (use 
  236. .C compress 
  237. on it if you wish to save space; Crack will unpack it whilst generating
  238. the big dictionary) and then delete the contents of the
  239. .C Dicts
  240. directory by running
  241. .C Scripts/spotless .
  242. Your new dictionary will be merged in on the next run. For more
  243. information on dictionary attacks, see the
  244. .I excellent
  245. paper called "Foiling the Cracker: A Survey of, and Improvements to,
  246. Password Security" by Daniel Klein, available from
  247. .I "ftp.sei.cmu.edu"
  248. in
  249. .I "~/pub/dvk/passwd.*" .
  250. Also, please read the
  251. .C APPENDIX
  252. file supplied with this distribution.\**
  253. .FS
  254. Extra dictionaries (those detailed in Dan Klein's paper) can be
  255. obtained via anonymous FTP from
  256. .I ftp.uu.net
  257. (137.39.1.9) as
  258. .I ~/pub/dictionaries.tar.Z ;
  259. or check an
  260. .I Archie
  261. database for other possible sources of dictionaries.
  262. .FE
  263. .LP
  264. Having described the method of cracking, perhaps we should now
  265. investigate the algorithm used to overlay the cracking mechanism.
  266. .NH 1
  267. Crack Methodology - Part 2: Feedback Filters
  268. .LP
  269. As is stated above, Crack permutes and loads dictionaries directly
  270. into memory, sorts and uniques them, before attempting to use each of
  271. the words as a guess for each users' password.  If Crack correctly
  272. guesses a password, it marks the user as
  273. .I done
  274. and does not waste
  275. further time on trying to break that users password.
  276. .LP
  277. Once Crack has finished a dictionary pass, it sweeps the list of users
  278. looking for the passwords it has cracked. It stores the cracked passwords
  279. in both plaintext and encrypted forms in a
  280. .I "feedback file"
  281. in the directory
  282. .C Runtime .
  283. Feedback files have names of the form
  284. .C Runtime/F* .
  285. .LP
  286. The purpose of this is so that, when Crack is next invoked, it may
  287. recognise passwords that it has successfully cracked before, and filter
  288. them from the input to the password cracker. This provides an
  289. .I instant
  290. list of crackable users who have not changed their passwords since the
  291. last time Crack was run. This list appears in a file with name 
  292. .C out*
  293. in the
  294. .C $CRACK_OUT
  295. directory, or on
  296. .I stdout ,
  297. if foreground mode is invoked (see
  298. .I Options ,
  299. below).
  300. .LP
  301. In a similar vein, when a Crack run terminates normally, it writes out
  302. to the feedback file all encrypted passwords that it has
  303. .B NOT
  304. succeeded in cracking.  Crack will then ignore all of these passwords
  305. next time you run it.
  306. .LP
  307. Obviously, this is not desirable if you frequently change your
  308. dictionaries or rules, and so there is a script provided,
  309. .C Scripts/mrgfbk
  310. which sorts your feedback files, merges them into one, and optionally
  311. removes all traces of 'uncrackable' passwords, so that your next Crack
  312. run can have a go at passwords it has not succeeded in breaking before.
  313. .LP
  314. .C Mrgfbk
  315. is invoked automatically if you run
  316. .C Scripts/spotless .
  317. .NH 1
  318. Crack Methodology - Part 3: Execution and Networking
  319. .LP
  320. Each time Crack is invoked, whether networked or not, it generates a
  321. .I diefile
  322. with a name of the form
  323. .C Runtime/D*
  324. (for network cracks, this file is generated by RCrack, and is of the form
  325. .C Runtime/DR*
  326. which points to a
  327. .B real
  328. diefile, named
  329. .C Runtime/RD* 
  330. - see below for details).
  331. .LP
  332. These diefiles contain debugging information about the job, and are
  333. generated so that all the jobs on the entire network can be called
  334. quickly by invoking
  335. .C Scripts/plaster .
  336. Diefiles delete themselves after they have been run.
  337. .LP
  338. As you will read in the sections below, Crack has a
  339. .C "-network"
  340. option: This is designed to be a simple method of automatically
  341. spreading the load of password cracking out over several machines on a
  342. network, preferably if they are connected by some form of networked
  343. filestore.
  344. .LP
  345. When
  346. .C "Crack -network"
  347. is invoked, it filters its input in the ordinary way, and then splits
  348. its load up amongst several machines which are specified in the file
  349. .C Scripts/network.conf .
  350. .LP
  351. This file contains a series of hostnames, power ratings, flags, etc,
  352. relevant to the running of Crack on each machine.  Crack then calls
  353. .C Scripts/RCrack
  354. to use the
  355. .C rsh
  356. command (or similar) to invoke Crack on the other hosts.  See the RCrack
  357. script, and the example network.conf file for details.
  358. .NH 1
  359. Installation
  360. .LP
  361. Crack is one of those most unusual of beasties, a self-installing
  362. program.  Some people have complained about this apparent weirdness, but
  363. it has grown up with Crack ever since the earliest network version, when
  364. I could not be bothered to log into several different machines with
  365. several different architectures, just in order to build the binaries. 
  366. Once the necessary configuration options have been set, the executables
  367. are created via
  368. .C make
  369. by running the Crack shellscript .
  370. .LP
  371. Crack's configuration lies in two files, the
  372. .C Crack
  373. shell script, which contains all the installation specific configuration
  374. data, and the file
  375. .C Sources/conf.h ,
  376. which contains configuration options specific to various binary platforms.
  377. .LP
  378. In the Crack shellscript, you will have to edit the
  379. .C CRACK_HOME
  380. variable to the correct value.  This variable should be set to an
  381. absolute path name (names relative to
  382. .I ~username
  383. are OK, so long as you have some sort of
  384. .C csh )
  385. through which the directory containing Crack may be accessed on
  386. .B ALL
  387. the machines that Crack will be run on. There is a similar variable
  388. .C CRACK_OUT
  389. which specifies where Crack should put its output files - by default,
  390. this is the same as
  391. .C "$CRACK_HOME" .
  392. .LP
  393. You will also have to edit the file
  394. .C Sources/conf.h
  395. and work out which switches to enable.  Each
  396. .C #define
  397. has a small note explaining its purpose.  Where I have been in doubt about
  398. the portability of certain library functions, usually I have re-written
  399. it, so you should be OK.  Let me know of your problems, if you have any.
  400. .LP
  401. If you will be using
  402. .C "Crack -network"
  403. you will then have to generate a
  404. .C Scripts/network.conf
  405. file. This contains a list of hostnames to
  406. .C rsh
  407. to, what their
  408. .I "binary type"
  409. is (useful when running a network Crack on several different
  410. architectures), a guesstimate of their
  411. .I "relative power"
  412. (take your slowest machine as unary, and measure all others relative to
  413. it), and a list of per-host
  414. .I flags
  415. to
  416. .B add
  417. to those specified on the
  418. .C Crack
  419. command line, when calling that host.  There is an example of such a
  420. file provided in the Scripts directory - take a look at it.
  421. .LP
  422. If ever you wish to specify a more precise figure as to the relative
  423. power of your machines, or you are simply at a loss, play with the
  424. command
  425. .C "make tests"
  426. in the source code directory.  This can provide you with the number of
  427. fcrypt()s that your machine can do per second, which is a number that
  428. you can plug into your
  429. .C network.conf
  430. as a measure of your machines' power (after rounding the value to an
  431. integer).
  432. .NH 1
  433. Usage
  434. .LP
  435. Okay, so, let's assume that you have edited your
  436. .C Crack
  437. script, and your
  438. .C Sources/conf.h
  439. file, where do you go from here ?
  440. .LP
  441. .DS B
  442. .fi
  443. .C Crack
  444. [\c
  445. .I options ]
  446. [\c
  447. .I bindir ]
  448. .C /etc/passwd
  449. [...other passwd files]
  450. .sp 1v
  451. .C "Crack -network"
  452. [\c
  453. .I options ]
  454. .C /etc/passwd
  455. [...other passwd files]
  456. .DE
  457. .LP
  458. Where
  459. .B bindir
  460. is the optional name of the directory where you want the binaries
  461. installed.  This is useful where you want to be able to run versions of
  462. Crack on several different architectures. If
  463. .B bindir
  464. does not exist, a warning will be issued, and the directory created.
  465. .QP
  466. Note:
  467. .B bindir
  468. defaults to the name
  469. .C generic
  470. if not supplied.
  471. .QP
  472. .LP
  473. .B "Notes for Yellow Pages (NIS) Users:"
  474. I have occasional queries about how to get Crack running from a YP
  475. password file.  There are several methods, but by far the simplest is to
  476. generate a passwd format file by running:-
  477. .DS B
  478. .C "ypcat passwd > passwd.yp"
  479. .DE
  480. and then running Crack on this file.
  481. .NH 1
  482. Options
  483. .IP "\fB-f\fP"
  484. Runs Crack in
  485. .I foreground
  486. mode, ie: the password cracker is not backgrounded, and messages appear
  487. on stdout and stderr as you would expect.  This option is only really
  488. useful for very small password files, or when you want to put a wrapper
  489. script around Crack.
  490. .IP
  491. Foreground mode is disabled if you try running
  492. .C "Crack -network -f"
  493. on the command line, because of the insensibility of
  494. .C rsh ing
  495. to several machines in turn, waiting for each one to finish before
  496. calling the next. However, please read the section about
  497. .I "Network Cracking without NFS/RFS" ,
  498. below.
  499. .IP "\fB-v\fP"
  500. Sets verbose mode, whereby Crack will print every guess it is trying on
  501. a per-user basis.  This is a very quick way of flooding your filestore,
  502. but useful if you think something is going wrong.
  503. .IP "\fB-m\fP"
  504. Sends mail to any user whose password you crack by invoking
  505. .C Scripts/nastygram
  506. with their username as an argument.  The reason for using the script is
  507. so that a degree of flexibility in the format of the mail message is
  508. supplied; ie: you don't have to recompile code in order to change the
  509. message.\**
  510. .FS
  511. I'm uncertain about the wisdom of mailing someone like this.  If someone
  512. browses your cracked user's mail somehow, it's like a great big neon
  513. sign pointing at the user saying "This Is A Crackable Account - Go For
  514. It!".  Not to mention the false sense of security it engenders in the
  515. System Manager that he's "informed" the user to change his password.
  516. What if the user doesn't log on for 3 months? However, so many people
  517. have wired it into their own versions of Crack, I suppose it
  518. .B must
  519. be provided... AEM
  520. .FE
  521. .IP "\fB-nvalue\fP"
  522. Sets the process to be
  523. .C nice() ed
  524. to
  525. .I value ,
  526. so, for example, the switch
  527. .C \&-n19
  528. sets the Crack process to run at the lowest priority.
  529. .IP "\fB-network\fP"
  530. Throws Crack into network mode, in which it reads the
  531. .C Scripts/network.conf
  532. file, splits its input into chunks which are sized according to the
  533. power of the target machine, and calls
  534. .C rsh
  535. to run Crack on that machine.  Options for Crack running on the target
  536. machine may be supplied on the command line (eg: verbose or recover
  537. mode), or in the network.conf file if they pertain to specific hosts
  538. (eg:
  539. .C nice()
  540. values).
  541. .IP "\fB-r<pointfile>\fP"
  542. This is only for use when running in
  543. .I recover
  544. mode.  When a running Crack starts pass 2, it periodically saves its
  545. state in a
  546. .I pointfile ,
  547. with a name of the form
  548. .C "Runtime/P.*"
  549. This file can be used to recover where you were should a host crash.
  550. Simply invoke Crack in
  551. .B exactly
  552. the same manner as the last time, with the addition of the
  553. .C "-r"
  554. switch, (eg:
  555. .C "-rRuntime/Pfred12345" )
  556. switch.  Crack will startup and read the file, and jump to roughly where
  557. it left off.  If you are cracking a very large password file, this can
  558. save oodles of time after a crash.
  559. .IP
  560. If you were running a
  561. .I network
  562. Crack, then the jobs will again be spawned onto all the machines of the
  563. original Crack.  The program will then check that the host it is running
  564. on is the same as is mentioned in the pointfile.  If it is not, it will
  565. quietly die.  Thus, assuming that you supply the same input data and do
  566. not change your
  567. .C network.conf
  568. file, Crack should pick up where it left off.  This is a bit inelegant,
  569. but it's better than nothing at the moment.
  570. .IP
  571. The method of error recovery outlined above causes headaches for users
  572. who want to do multiprocessing on parallel architectures.  Crack is in
  573. no way parallel, and because of the way it's structured (reading stdin
  574. from shellscript frontends) it is a pain to divide the work amongst
  575. several processes via
  576. .C fork() ing.
  577. .IP
  578. The hack solution to get several copies of Crack running on one machine
  579. with
  580. .I n
  581. processors at the moment is to insert
  582. .I n
  583. copies of the entry for your parallel machine into the
  584. .C Scripts/network.conf
  585. file. If you use the
  586. .C \&-r
  587. option in these circumstances however, you will get
  588. .I n
  589. copies of the recovered process running, only one of them will have the
  590. correct input data.
  591. .IP
  592. The old solution to this problem (see old documentation if you are
  593. interested) has been negated by the introduction of feedback mode, so
  594. the best bet in this particular situation is to wait until the other
  595. jobs are done (and have written out lists of uncrackable passwords), and
  596. then re-start the jobs from scratch.  Anyone whose password was not
  597. cracked on the first run will be ignored on the second, if they have not
  598. changed it since.  This is inelegant, but it's the best I can do in the
  599. limited time available.
  600. .NH
  601. Support Scripts
  602. .LP
  603. The
  604. .C Scripts
  605. directory contains a small number of support and utility scripts, some
  606. of which are designed to help Crack users check their progress.
  607. Briefly, the most useful ones are:-
  608. .IP "\fBScripts/shadmrg\fP"
  609. This is a small (but hopefully readable) script for merging
  610. .C /etc/passwd
  611. and
  612. .C /etc/shadow
  613. on System V style shadow password systems.  It produces the merged data
  614. to stdout, and will need redirecting into a file before Crack can work
  615. on it.  The script is meant to be fairly lucid, on the grounds that I
  616. worry that there are many shadowing schemes out there, and perhaps not
  617. all have the same data format.
  618. .IP
  619. .B "I have not"
  620. wired this facility into the Crack command itself because the world does
  621. .B NOT
  622. revolve around System V yet, regardless of what some people would have
  623. me believe, and I believe that the lack of direct support for NIS
  624. outlined above, sets a precedent.  There are just too many
  625. incompatibilities in shadow password schemes for me to hardwire
  626. anything.
  627. .IP "\fBScripts/plaster\fP"
  628. which is named after a dumb joke, but is a simple frontend to the
  629. .C "Runtime/D*"
  630. diefiles that each copy of the password cracker generates. Invoking
  631. .C Scripts/plaster
  632. will kill off all copies of the password cracker you are running, over
  633. the network or otherwise.
  634. .IP "\fBScripts/status\fP"
  635. This script
  636. .C rsh es
  637. to each machine mentioned in the
  638. .C Scripts/network.conf
  639. file, and provides some information about processes and uptime on that
  640. machine.  This is useful when you want to find out just how well your
  641. password crackers are getting on during a
  642. .C "Crack -network" .
  643. .IP "\fBScripts/{clean,spotless}\fP"
  644. These are really just frontends to a makefile. Invoking
  645. .C Scripts/clean
  646. tidies up the Crack home directory, and removes probably unwanted files,
  647. but leaves the pre-processed dictionary
  648. .C bigdict
  649. intact.
  650. .C Scripts/spotless
  651. does the same as
  652. .C Scripts/clean
  653. but obliterates
  654. .C bigdict
  655. and old output files too, and compresses the feedback files into one.
  656. .IP "\fBScripts/nastygram\fP"
  657. This is the shellscript that is invoked by the password cracker to send
  658. mail to users who have guessable passwords, if the
  659. .C -m
  660. option is used. Edit it at your leisure to suit your system.
  661. .IP "\fBScripts/guess2fbk\fP"
  662. This script takes your
  663. .C out*
  664. files as arguments and reformats the 'Guessed' lines into a slightly
  665. messy
  666. .I feedback
  667. file, suitable for storing with the others.
  668. .IP
  669. An occasion where this might be useful is when your cracker has guessed
  670. many peoples passwords, and then died for some reason (a crash?) before
  671. writing out the guesses to a feedback file.  Running
  672. .DS B
  673. .C "Scripts/guess2fbk out* >> Runtime/F.new"
  674. .DE
  675. will save the work that has been done.
  676. .NH 1
  677. Network Cracking without NFS/RFS
  678. .LP
  679. For those users who have some form of
  680. .C rsh
  681. command, but do not have a a networked filestore running between hosts,
  682. there is now a solution which will allow you to do networked cracking,
  683. proposed to me by Brian Tompsett at Hull.  Personally, I consider the
  684. idea to be potty, but it fills in missing functionality in a wonderfully
  685. tacky manner.
  686. .LP
  687. From the documentation above, you will note that Crack will undo the
  688. .C "-f"
  689. .I "(output in foreground)"
  690. option, if it is invoked with the
  691. .C "-network"
  692. switch at the same time (see the
  693. .I Options
  694. section above).  This is true, but it does not apply if you specify
  695. .C "-f"
  696. option in the
  697. .C network.conf
  698. file.
  699. .LP
  700. The practical upshot of doing this is that remote copies of Crack
  701. can be made to read from
  702. .I stdin
  703. and write to
  704. .I stdout
  705. over a network link, and thus remote processing is accomplished.  I have
  706. tweaked Crack in such a way, therefore, that if the
  707. .C "-f"
  708. option is specified amongst the crack-flags of a host in the
  709. network.conf, rather than backgrounding itself on the remote host, the
  710. .C rsh
  711. command on the
  712. .B server
  713. is backgrounded, and output is written directly to the files on the
  714. server's filestore.
  715. .LP
  716. There are restrictions upon this method, mostly involving the number of
  717. processes that a user may run on the server at any one time, and that
  718. you will have to collect feedback output together manually (dropping it
  719. into the
  720. .C Runtime
  721. directory on the server).  However, it works. Also, if you try to use
  722. .C rsh
  723. as another user, you will suffer problems if
  724. .C rsh
  725. insists on reading something from your terminal (eg: a password for the
  726. remote account).  Also, recovering using checkpointing goes out the
  727. window unless you specify the name of the pointfile as it is named
  728. on the remote machine.
  729. .NH 1
  730. UFC Support and notes on fast crypt() implementations
  731. .LP
  732. The stdlib version of the
  733. .C crypt()
  734. subroutine is incredibly slow.  It is a
  735. .I massive
  736. bottleneck to the execution of Crack and on typical platforms that you
  737. get at universities, it is rare to find a machine which will achieve
  738. more than 50 standard crypt() s per second.  On low-end diskless
  739. workstations, you may expect 2 or 3 per second.  It was this slowness of
  740. the crypt() algorithm which originally supplied much of the security
  741. Unix needed.\**
  742. .FS
  743. See: "Password Security, A Case History" by Bob Morris & Ken Thomson, in
  744. the Unix Programmer Docs.
  745. .FE
  746. .LP
  747. There are now
  748. .B many
  749. implementations of faster versions of crypt()
  750. to be found on the network.  The one supplied with Crack v3.2 and
  751. upwards is called
  752. .C fcrypt() .
  753. It was originally written in May 1986 by Robert Baldwin at MIT, and is a
  754. good version of the crypt() subroutine.  I received a copy from Icarus
  755. Sparry at Bath University, who had made a couple of portability
  756. enhancements to the code.
  757. .LP
  758. I rewrote most of the tables and the KeySchedule generating algorithm in
  759. the original
  760. .I fdes-init.c
  761. to knock 40% off the execution overhead of fcrypt() in the form that it
  762. was shipped to me.  I inlined a bunch of stuff, put it into a single
  763. file, got some advice from Matt Bishop and Bob Baldwin [both of whom I
  764. am greatly indebted to] about what to do to the
  765. .C xform()
  766. routine and to the fcrypt function itself, and tidied up some
  767. algorithms.  I have also added more lookup tables and reduced several
  768. formula for faster use.  Fcrypt() is now barely recognisable as being
  769. based on its former incarnation, and it is 3x faster.
  770. .LP
  771. On a DecStation 5000/200, fcrypt() is about 16 times faster than the
  772. standard crypt (your mileage may vary with other architectures and
  773. compilers).  This speed puts fcrypt() into the "moderately fast" league
  774. of crypt implementations. 
  775. .LP
  776. Amongst other crypt implementations available is
  777. .B UFC
  778. by Michael Glad.  UFC-crypt is a version of the crypt subroutine which
  779. is optimised for machines with 32-bit long integers and generally
  780. outperforms my fcrypt() by a factor of between 1 and 3, for a tradeoff
  781. of large memory usage, and memory-cache unfriendliness.  Hooks for even
  782. more optimised assembler versions of crypt() are also provided for some
  783. platforms (Sun, HP, ...).  Getting UFC to work on 16 bit architectures
  784. is nearly impossible.
  785. .LP
  786. However, on most architectures, UFC generates a stunning increase in the
  787. power of Crack, and so, from v4.1 onwards, Crack is written to
  788. automatically make use of UFC if it can find it.  All that you have to
  789. do is to obtain a suitable copy of UFC (preferably a version which
  790. mentions that it is compatible with
  791. .C "Crack v4.1" ,
  792. and unpack it into a directory called
  793. .C ufc-crypt
  794. in
  795. .C $CRACK_HOME ,
  796. and then delete your old binaries.  UFC will then be detected, compiled,
  797. tested and used in preference to fcrypt() by the Crack program, wherever
  798. possible.
  799. .NH 1
  800. Conclusions
  801. .LP
  802. What can be done about brute force attacks on your password file ?
  803. .LP
  804. You must get a drop-in replacement for the
  805. .C passwd
  806. and
  807. .C yppasswd
  808. commands; one which will stop people from choosing bad passwords in the
  809. first place.  There are several programs to do this; Matt Bishop's
  810. .C "passwd+"
  811. and Clyde Hoover's
  812. .C "npasswd"
  813. program are good examples which are freely available.  Consult an
  814. .B Archie
  815. database for more details on where you can get them from.
  816. .LP
  817. It would be nice if an organisation (such as
  818. .B CERT ?)
  819. could be persuaded to supply skeletons of
  820. .I sensible
  821. passwd commands for the public good, as well as an archive of security
  822. related utilities\**
  823. on top of the excellent
  824. .C COPS .
  825. .FS
  826. .C COPS
  827. is available for anonymous FTP from
  828. .I "cert.sei.cmu.edu"
  829. (128.237.253.5) in
  830. .I ~/cops
  831. .FE
  832. However, for Unix security to improve on a global scale, we will also
  833. require pressure on the vendors, so that programs are written correctly
  834. from the beginning.
  835.